using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace Microsoft.Phone.Controls.Maps
{
	public sealed class ApplicationIdCredentialsProvider : CredentialsProvider, INotifyPropertyChanged
	{
		private string applicationId;
		public event PropertyChangedEventHandler PropertyChanged
		{
			[MethodImpl(32)]
			add
			{
				this.PropertyChanged = (PropertyChangedEventHandler)Delegate.Combine(this.PropertyChanged, value);
			}
			[MethodImpl(32)]
			remove
			{
				this.PropertyChanged = (PropertyChangedEventHandler)Delegate.Remove(this.PropertyChanged, value);
			}
		}
		public string ApplicationId
		{
			get
			{
				return this.applicationId;
			}
			set
			{
				this.applicationId = value;
				this.OnPropertyChanged("ApplicationId");
			}
		}
		public ApplicationIdCredentialsProvider() : this(string.Empty)
		{
		}
		public ApplicationIdCredentialsProvider(string applicationId)
		{
			this.ApplicationId = applicationId;
		}
		public override void GetCredentials(Action<Credentials> callback)
		{
			callback.Invoke(new Credentials
			{
				ApplicationId = this.ApplicationId
			});
		}
		private void OnPropertyChanged(string propertyName)
		{
			PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
			if (propertyChanged != null)
			{
				PropertyChangedEventArgs propertyChangedEventArgs = new PropertyChangedEventArgs(propertyName);
				propertyChanged.Invoke(this, propertyChangedEventArgs);
			}
		}
	}
}
